package com.dlc.shop.sms4j;

import com.dlc.shop.sms4j.config.ReadConfig;
import com.dlc.shop.sms4j.dao.BizSmsDao;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author zp
 */
@Component
@Import(BizSmsDao.class)
public class Load {
    @Autowired
    private ReadConfig config;
    @EventListener
    public void init(ApplicationContextEvent event){
        // 创建SmsBlend 短信实例
        SmsFactory.createSmsBlend(config);
    }

}
